$(document).ready(function(){
    $('#chat-submit').click(function(){
        var $ctext = $('#chat-text').val();
        var dataString = "ct="+$ctext;
        if($ctext != '' || $ctext != ' '){
            $.ajax({
                type: 'GET',
                url: "./SourceCode/addchat.php",
                data: dataString,
                success: function(server_response) {
                    $('#list-content').html(server_response);
                }
            });
        }
    });
});

$(document).ready(function(){
    $.ajaxSetup({cache:false});
    setInterval(function(){$('#list-content').load('./SourceCode/loadchat.php');},2000);
});